<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
	</head>
	<body ng-app="myapp" ng-controller="mycontroller">
		<div> 
			<table border="1" width="100%"> 
				<tr>
					<td>商品序号</td>
					<td>商品名称</td>
					<td>商品价格</td>
					<td>商品数量</td>
				</tr>
				<tr ng-repeat="product in products">
					<td>{{$index+1}}</td>
					<td>{{product.name}}</td>
					<td>{{product.price}}</td>
					<td>{{product.num}}</td>
				</tr>
			</table>
		</div>
	</body>
	<script type="text/javascript">
		//初始化myapp模块
		var myapp = angular.module("myapp",[]);
		//定义模块的控制器
		myapp.controller("mycontroller",["$scope",function($scope){
			$scope.products=[{
				name:"电视机",
				price:4000,
				num:2000
			},{name:"电冰箱",
				price:3000,
				num:1000}]
		}]);
	</script>
</html>
